import request from '@/utils/request'

// 创建生产入库单
export function createProduceIn(data) {
  return request({
    url: '/wms/produce-in/create',
    method: 'post',
    data: data
  })
}

// 更新生产入库单
export function updateProduceIn(data) {
  return request({
    url: '/wms/produce-in/update',
    method: 'put',
    data: data
  })
}

// 删除生产入库单
export function deleteProduceIn(id) {
  return request({
    url: '/wms/produce-in/delete?id=' + id,
    method: 'delete'
  })
}

// 获得生产入库单
export function getProduceIn(id) {
  return request({
    url: '/wms/produce-in/get?id=' + id,
    method: 'get'
  })
}

// 审核
export function approveProduceIn(id) {
  return request({
    url: '/wms/produce-in/approve?id=' + id,
    method: 'put'
  })
}

// 撤审
export function cancelProduceIn(id) {
  return request({
    url: '/wms/produce-in/cancel?id=' + id,
    method: 'put'
  })
}

// 获得生产入库单分页
export function getProduceInPage(query) {
  return request({
    url: '/wms/produce-in/page',
    method: 'get',
    params: query
  })
}

// 导出生产入库单 Excel
export function exportProduceInExcel(query) {
  return request({
    url: '/wms/produce-in/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}


